dependencies "authenticated_system_controller", "merb_helpers"
class Users < Application
  provides :xml
  
  skip_before :login_required
  
  def new(user = {})
    only_provides :html
    @user = User.new(user)
    render @user
  end
  
  def show
    @user = User.find(params[:id])
    if @user.id == current_user.id
      render @user
    else
      redirect url(:login)
    end
  end
  
  
  def create(user)
    cookies.delete :auth_token
    
    @user = User.new(user)
    if @user.save
      redirect_back_or_default('/')
    else
      render :action => :new
    end
  end
  
end